package it.tukano.fun;

/**
 * Three immutable values
 * @author pgi
 * @param <A> the first element of the tuple
 * @param <B> the second element of the tuple
 * @param <C> the third element of the tuple
 */
public class Tuple3<A, B, C> {

    /**
     * Creator
     * @param <A> the type of the first element
     * @param <B> the type of the second element
     * @param <C> the type of the third element
     * @param a the first element
     * @param b the second element
     * @param c the third element
     * @return the new tuple
     */
    public static <A, B, C> Tuple3<A, B, C> newInstance(A a, B b, C c) {
        return new Tuple3<A, B, C>(a, b, c);
    }

    /** The first element */
    private final A a;
    /** The second element */
    private final B b;
    /** The third element */
    private final C c;

    /**
     * Initializes this tuple
     * @param a the first element
     * @param b the second element
     * @param c the third element
     */
    public Tuple3(A a, B b, C c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    /**
     * The first element
     * @return the first element
     */
    public A getA() {
        return a;
    }

    /**
     * The second element
     * @return the second element
     */
    public B getB() {
        return b;
    }

    /**
     * The third element
     * @return the third element
     */
    public C getC() {
        return c;
    }
}
